home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CLPMOUSE.ARJ
/
TMOUSE.PRG
< prev
next >
Wrap
Text File
|
1991-06-17
|
1KB
|
47 lines
FUNCTION SMOUSE(mx,my,mx1,my1,mb,mb1)
local DMOUSE, ax, ay, ab, yxb_pos
/* This function will return the setting if the conditions are satisfied
SYNTAX: MOUSE(n1,n2,n3[,n4,n5,n6])
n1 = Beginning X-coordinate range
n2 = Beginning Y-coordinate range
n3 = Beginning Button range
n4 = Ending X-coordinate range
n5 = Ending Y-coordinate range
n6 = Ending Button range
NOTE: If parameters n4-n6 are not used, explicit coordinates are called for.
ie, MOUSE(10,12,1) requires that button 1 is pressed with
the mouse on row 10, column 12.
MOUSE(10,12,1,15,30,3) requires that any button or both be
pressed with the mouse cursor within
rows 10-15, and columns 12-30. */
/* First, call assembler routines */
ay = MS_XPOS()
ax = MS_YPOS()
ab = MS_BPOS()
yxb_pos = padl(ax,2,"0")+padl(ay,2,"0")+alltrim(str(ab))
/* Break it out into elements */
if pcount() > 3
/* all parameters are used */
if (ax >= mx) .and. (ay >= my) .and. (ab >= mb)
if (ax <= mx1) .and. (ay <= my1) .and. (ab <= mb1)
return(yxb_pos)
else
return(NIL)
endif
else
return(NIL)
endif
else
/* only three are used */
return(if((ax=mx).and.(ay=my).and.(ab=mb),yxb_pos,NIL))
endif
return(NIL)